cmake_minimum_required(VERSION 3.12)
project(sonar)

# 设置输出路径
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# 手动指定源文件（或使用file(GLOB)）
set(SOURCE_FILES
    src/main.cpp
    src/common.cpp
    src/gnss.cpp
    src/sonar.cpp
)

# 创建可执行文件
add_executable(${PROJECT_NAME} ${SOURCE_FILES})

target_link_libraries(${PROJECT_NAME} pthread)  # 直接链接-lpthread
# 添加头文件目录
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/include)